@extends('layouts.home')
@extends('layouts.nav')
@extends('layouts.top')

@section('heading')
    <h3>
        系统设置
    </h3>
    <ul class="breadcrumb">
        <li>
            <a href="#">系统设置</a>
        </li>
        <li class="active"> 云纯存储</li>
    </ul>
@endsection


@section('wrapper')
    <section class="panel">

        <div class="panel-body">
            <div class=" form">
                @if(isset($config))
                    <form method="POST" action="{{ route('qi-niu-config.update', $config->id) }}" class="cmxform form-horizontal adminex-form">
                        {{ method_field('PATCH') }}
                @else
                    <form method="POST" action="{{ route('qi-niu-config.store') }}" class="cmxform form-horizontal adminex-form">
                @endif
                    @csrf
                    <div class="form-group ">
                        <label for="cname" class="control-label col-lg-2">名称</label>
                        <div class="col-lg-5">
                            <input class=" form-control{{ $errors->has('name') ? ' error' : '' }}" id="cname" value="{{ $config->name or old('name') }}" name="name" minlength="2" type="text" required/>
                            @if ($errors->has('name'))
                                <label class="error">{{ $errors->first('name') }}</label>
                            @endif
                        </div>
                    </div>
                    <div class="form-group ">
                        <label for="cname" class="control-label col-lg-2">accessKey</label>
                        <div class="col-lg-5">
                            <input class=" form-control{{ $errors->has('access_key') ? ' error' : '' }}" id="cname" value="{{ $config->access_key or old('access_key') }}" name="access_key" minlength="2" type="text" required/>
                            @if ($errors->has('access_key'))
                                <label class="error">{{ $errors->first('access_key') }}</label>
                            @endif
                        </div>
                    </div>
                    <div class="form-group ">
                        <label for="cname" class="control-label col-lg-2">secretKey</label>
                        <div class="col-lg-5">
                            <input class=" form-control{{ $errors->has('secret_key') ? ' error' : '' }}" id="cname" value="{{ $config->secret_key or old('secret_key') }}" name="secret_key" minlength="2" type="text" required/>
                            @if ($errors->has('secret_key'))
                                <label class="error">{{ $errors->first('secret_key') }}</label>
                            @endif
                        </div>
                    </div>
                    <div class="form-group ">
                        <label for="cname" class="control-label col-lg-2">云空间名称</label>
                        <div class="col-lg-5">
                            <input class=" form-control{{ $errors->has('bucket') ? ' error' : '' }}" id="cname" value="{{ $config->bucket or old('bucket') }}" name="bucket" minlength="2" type="text" required/>
                            @if ($errors->has('bucket'))
                                <label class="error">{{ $errors->first('bucket') }}</label>
                            @endif
                        </div>
                    </div>
                    <div class="form-group ">
                        <label for="cname" class="control-label col-lg-2">访问地址</label>
                        <div class="col-lg-5">
                            <input class=" form-control{{ $errors->has('url') ? ' error' : '' }}" id="cname" value="{{ $config->url or old('url') }}" name="url" minlength="2" type="text"/>
                            @if ($errors->has('url'))
                                <label class="error">{{ $errors->first('url') }}</label>
                            @endif
                        </div>
                    </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label col-lg-2" for="inputSuccess">状态</label>
                            <div class="col-lg-5">
                                <select class="form-control m-bot15" name="status">
                                    <option value="">选择</option>
                                    <option value="0">禁用</option>
                                    <option value="1" selected>有效</option>
                                </select>
                            </div>
                            @if ($errors->has('status'))
                                <label class="error">{{ $errors->first('status') }}</label>
                            @endif
                        </div>
                    <div class="form-group">
                        <div class="col-lg-offset-2 col-lg-10">
                            <button class="btn btn-primary" type="submit">保存</button>
                        </div>
                    </div>
                </form>
            </div>

        </div>
    </section>
@endsection